<!-- 查看当前页的成交结算  -->
<template>
	<div>
		<el-breadcrumb separator="/" class="bread-title">
			<el-breadcrumb-item :to="{ path: '/transactionSettle' }">成交结算</el-breadcrumb-item>
			<el-breadcrumb-item :to="{ path: '/transactionSettle2',query:{tdata:tdata} }">成交详情</el-breadcrumb-item>
			<el-breadcrumb-item>交易订单</el-breadcrumb-item>
		</el-breadcrumb>
	    <el-form :inline="true" :model="ruleForm" class="demo-form-inline">
	    	<el-form-item label="客户姓名：">
				<el-input placeholder="请输入客户姓名" v-model.trim="ruleForm.customerName" maxlength="20" size="small"></el-input>
	    	</el-form-item>
	    	<el-form-item>
	    		<el-button type="success"  @click="searchList" id="monitorEnter" size="small">查询</el-button>
	    	</el-form-item>
	    </el-form>
		<el-table :data="tableData" border style="width: 100%">
			<el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
			<el-table-column label="客户姓名" prop="customerName" align="center"></el-table-column>
			<el-table-column label="房号信息" prop="houseInfo" align="center"></el-table-column>
			<el-table-column label="营收业绩(元)" prop="easylifeAmountTotal" align="center" :formatter="initCash"></el-table-column>
			<el-table-column label="营收结算计提节点"  prop="revenueNodeName"  align="center"></el-table-column>
			<el-table-column label="计提比例%"  prop="revenueCalProportion"  align="center"></el-table-column>
			<el-table-column label="营收结算（元）"  prop="revenueAmount" :formatter="initCash"  align="center"></el-table-column>
			<el-table-column label="房屋总价（元）"  prop="houseDealAmount" :formatter="initCash"  align="center"></el-table-column>
			<el-table-column label="成交结算计提节点"  prop="dealNodeName" align="center"></el-table-column>
			<el-table-column label="成交结算（元）"  prop="dealSettlementAmount" :formatter="initCash"  align="center"></el-table-column>
			<el-table-column label="营收业绩(元)"  prop="marketTotalAmount" align="center" :formatter="initCash"></el-table-column>
			<el-table-column label="市场结算计提节点"  prop="marketCalNodeName" align="center">
			</el-table-column>
			<el-table-column label="计提比例/金额"  prop="marketCalProportion" align="center"></el-table-column>
			<el-table-column label="市场结算"  prop="marketCalAmount" align="center" :formatter="initCash"></el-table-column>
		</el-table>
		<div class="pagebar">
		  <el-pagination
		    background
		    layout="total, sizes, prev, pager, next"
		    :current-page.sync="ruleForm.pageNum"
		    :page-sizes="[10, 20, 30, 40]"
		    :page-size="ruleForm.pageSize"
		    @size-change="handleSizeChange"
		    @current-change="handleCurrentChange"
		    :total="totalSize">
		  </el-pagination>
		</div>
	</div>
</template>
<script>
    import api from '@/api/apiPath'
	export default {
		data () {
			return {
				ruleForm:{
					customerName:undefined,
					month:undefined,
					devId:undefined,
					pageNum: 0,
					pageSize: 10,
				},
				levellist:[],
				devlist:[],
				totalSize:0,
				tableData:[],
				tdata:undefined,//面包屑传参数
			}
		},
		methods:{
			handleCurrentChange(){
				this.getlist()
			},
			handleSizeChange(val){
				this.ruleForm.pageSize = val
				this.getlist();
			},
			initCash(row, column, cellValue, index){
				if(!cellValue && typeof cellValue!="undefined" && cellValue!=0){
					 return '———'
				}
				if (cellValue < 0) {
					return cellValue
				}
			    if(cellValue !== 0 && cellValue >0){
			        return cellValue.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");
			    }
			    if(cellValue == 0){
			        return "0.00"
			    }
			},
			getlist(){
				this.axios.post(api.TRADEORDERLIST,this.ruleForm).then((res) => {
					if (res.data.code == 200) {
						this.tableData = res.data.data.data;
						this.totalSize = res.data.data.total;
					}
				})
			},
			searchList(){
				this.ruleForm.pageNum = 1
				this.getlist()
			}
		},
		created(){
			this.ruleForm.month = this.$route.query.month
			this.ruleForm.devId = this.$route.query.devId
			this.tdata = this.$route.query.tmonth
			this.getlist()
		}
	}

</script>
<style lang="stylus" scoped>
</style>